3.832 \(\int \frac{\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx\)

Optimal. Leaf size=91 \[ \frac{2 \tan ^7(c+d x)}{7 a^2 d}+\frac{\tan ^5(c+d x)}{5 a^2 d}-\frac{2 \sec ^7(c+d x)}{7 a^2 d}+\frac{4 \sec ^5(c+d x)}{5 a^2 d}-\frac{2 \sec ^3(c+d x)}{3 a^2 d} \]

[Out]

(-2*Sec[c + d*x]^3)/(3*a^2*d) + (4*Sec[c + d*x]^5)/(5*a^2*d) - (2*Sec[c + d*x]^7)/(7*a^2*d) + Tan[c + d*x]^5/(
5*a^2*d) + (2*Tan[c + d*x]^7)/(7*a^2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.156614, antiderivative size = 91, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {2711, 2607, 14, 2606, 270, 30} \[ \frac{2 \tan ^7(c+d x)}{7 a^2 d}+\frac{\tan ^5(c+d x)}{5 a^2 d}-\frac{2 \sec ^7(c+d x)}{7 a^2 d}+\frac{4 \sec ^5(c+d x)}{5 a^2 d}-\frac{2 \sec ^3(c+d x)}{3 a^2 d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^4/(a + a*Sin[c + d*x])^2,x]

[Out]

(-2*Sec[c + d*x]^3)/(3*a^2*d) + (4*Sec[c + d*x]^5)/(5*a^2*d) - (2*Sec[c + d*x]^7)/(7*a^2*d) + Tan[c + d*x]^5/(
5*a^2*d) + (2*Tan[c + d*x]^7)/(7*a^2*d)

Rule 2711

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.), x_Symbol] :> Dist[a^(2*
m), Int[ExpandIntegrand[(g*Tan[e + f*x])^p/Sec[e + f*x]^m, (a*Sec[e + f*x] - b*Tan[e + f*x])^(-m), x], x], x]
/; FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && ILtQ[m, 0]

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps

\begin{align*} \int \frac{\tan ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx &=\frac{\int \left (a^2 \sec ^4(c+d x) \tan ^4(c+d x)-2 a^2 \sec ^3(c+d x) \tan ^5(c+d x)+a^2 \sec ^2(c+d x) \tan ^6(c+d x)\right ) \, dx}{a^4}\\ &=\frac{\int \sec ^4(c+d x) \tan ^4(c+d x) \, dx}{a^2}+\frac{\int \sec ^2(c+d x) \tan ^6(c+d x) \, dx}{a^2}-\frac{2 \int \sec ^3(c+d x) \tan ^5(c+d x) \, dx}{a^2}\\ &=\frac{\operatorname{Subst}\left (\int x^6 \, dx,x,\tan (c+d x)\right )}{a^2 d}+\frac{\operatorname{Subst}\left (\int x^4 \left (1+x^2\right ) \, dx,x,\tan (c+d x)\right )}{a^2 d}-\frac{2 \operatorname{Subst}\left (\int x^2 \left (-1+x^2\right )^2 \, dx,x,\sec (c+d x)\right )}{a^2 d}\\ &=\frac{\tan ^7(c+d x)}{7 a^2 d}+\frac{\operatorname{Subst}\left (\int \left (x^4+x^6\right ) \, dx,x,\tan (c+d x)\right )}{a^2 d}-\frac{2 \operatorname{Subst}\left (\int \left (x^2-2 x^4+x^6\right ) \, dx,x,\sec (c+d x)\right )}{a^2 d}\\ &=-\frac{2 \sec ^3(c+d x)}{3 a^2 d}+\frac{4 \sec ^5(c+d x)}{5 a^2 d}-\frac{2 \sec ^7(c+d x)}{7 a^2 d}+\frac{\tan ^5(c+d x)}{5 a^2 d}+\frac{2 \tan ^7(c+d x)}{7 a^2 d}\\ \end{align*}

Mathematica [A]  time = 0.247231, size = 126, normalized size = 1.38 \[ -\frac{\sec ^3(c+d x) (-1232 \sin (c+d x)-824 \sin (2 (c+d x))+1896 \sin (3 (c+d x))-412 \sin (4 (c+d x))-72 \sin (5 (c+d x))-1442 \cos (c+d x)+1664 \cos (2 (c+d x))-309 \cos (3 (c+d x))-288 \cos (4 (c+d x))+103 \cos (5 (c+d x))+672)}{13440 a^2 d (\sin (c+d x)+1)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^4/(a + a*Sin[c + d*x])^2,x]

[Out]

-(Sec[c + d*x]^3*(672 - 1442*Cos[c + d*x] + 1664*Cos[2*(c + d*x)] - 309*Cos[3*(c + d*x)] - 288*Cos[4*(c + d*x)
] + 103*Cos[5*(c + d*x)] - 1232*Sin[c + d*x] - 824*Sin[2*(c + d*x)] + 1896*Sin[3*(c + d*x)] - 412*Sin[4*(c + d
*x)] - 72*Sin[5*(c + d*x)]))/(13440*a^2*d*(1 + Sin[c + d*x])^2)

________________________________________________________________________________________

Maple [A]  time = 0.122, size = 160, normalized size = 1.8 \begin{align*} 32\,{\frac{1}{d{a}^{2}} \left ( -{\frac{1}{384\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -1 \right ) ^{3}}}-{\frac{1}{256\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) -1 \right ) ^{2}}}+{\frac{1}{256\,\tan \left ( 1/2\,dx+c/2 \right ) -256}}-{\frac{1}{56\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) +1 \right ) ^{7}}}+1/16\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) +1 \right ) ^{-6}-{\frac{3}{40\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) +1 \right ) ^{5}}}+1/32\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) +1 \right ) ^{-4}+{\frac{1}{384\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) +1 \right ) ^{3}}}-{\frac{1}{256\, \left ( \tan \left ( 1/2\,dx+c/2 \right ) +1 \right ) ^{2}}}-{\frac{1}{256\,\tan \left ( 1/2\,dx+c/2 \right ) +256}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4*sin(d*x+c)^4/(a+a*sin(d*x+c))^2,x)

[Out]

32/d/a^2*(-1/384/(tan(1/2*d*x+1/2*c)-1)^3-1/256/(tan(1/2*d*x+1/2*c)-1)^2+1/256/(tan(1/2*d*x+1/2*c)-1)-1/56/(ta
n(1/2*d*x+1/2*c)+1)^7+1/16/(tan(1/2*d*x+1/2*c)+1)^6-3/40/(tan(1/2*d*x+1/2*c)+1)^5+1/32/(tan(1/2*d*x+1/2*c)+1)^
4+1/384/(tan(1/2*d*x+1/2*c)+1)^3-1/256/(tan(1/2*d*x+1/2*c)+1)^2-1/256/(tan(1/2*d*x+1/2*c)+1))

________________________________________________________________________________________

Maxima [B]  time = 1.08625, size = 427, normalized size = 4.69 \begin{align*} -\frac{32 \,{\left (\frac{4 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac{3 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac{8 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac{14 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac{21 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + 1\right )}}{105 \,{\left (a^{2} + \frac{4 \, a^{2} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac{3 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac{8 \, a^{2} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac{14 \, a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac{14 \, a^{2} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac{8 \, a^{2} \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} - \frac{3 \, a^{2} \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} - \frac{4 \, a^{2} \sin \left (d x + c\right )^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}} - \frac{a^{2} \sin \left (d x + c\right )^{10}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{10}}\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-32/105*(4*sin(d*x + c)/(cos(d*x + c) + 1) + 3*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 8*sin(d*x + c)^3/(cos(d*x
 + c) + 1)^3 - 14*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 - 21*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 + 1)/((a^2 + 4*
a^2*sin(d*x + c)/(cos(d*x + c) + 1) + 3*a^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 8*a^2*sin(d*x + c)^3/(cos(d*
x + c) + 1)^3 - 14*a^2*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 + 14*a^2*sin(d*x + c)^6/(cos(d*x + c) + 1)^6 + 8*a^
2*sin(d*x + c)^7/(cos(d*x + c) + 1)^7 - 3*a^2*sin(d*x + c)^8/(cos(d*x + c) + 1)^8 - 4*a^2*sin(d*x + c)^9/(cos(
d*x + c) + 1)^9 - a^2*sin(d*x + c)^10/(cos(d*x + c) + 1)^10)*d)

________________________________________________________________________________________

Fricas [A]  time = 1.63311, size = 267, normalized size = 2.93 \begin{align*} -\frac{18 \, \cos \left (d x + c\right )^{4} - 44 \, \cos \left (d x + c\right )^{2} +{\left (9 \, \cos \left (d x + c\right )^{4} - 66 \, \cos \left (d x + c\right )^{2} + 25\right )} \sin \left (d x + c\right ) + 10}{105 \,{\left (a^{2} d \cos \left (d x + c\right )^{5} - 2 \, a^{2} d \cos \left (d x + c\right )^{3} \sin \left (d x + c\right ) - 2 \, a^{2} d \cos \left (d x + c\right )^{3}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/105*(18*cos(d*x + c)^4 - 44*cos(d*x + c)^2 + (9*cos(d*x + c)^4 - 66*cos(d*x + c)^2 + 25)*sin(d*x + c) + 10)
/(a^2*d*cos(d*x + c)^5 - 2*a^2*d*cos(d*x + c)^3*sin(d*x + c) - 2*a^2*d*cos(d*x + c)^3)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4*sin(d*x+c)**4/(a+a*sin(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.1964, size = 197, normalized size = 2.16 \begin{align*} \frac{\frac{35 \,{\left (3 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 9 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 4\right )}}{a^{2}{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1\right )}^{3}} - \frac{105 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{6} + 735 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 2030 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} + 2030 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 1701 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 707 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 116}{a^{2}{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1\right )}^{7}}}{840 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/840*(35*(3*tan(1/2*d*x + 1/2*c)^2 - 9*tan(1/2*d*x + 1/2*c) + 4)/(a^2*(tan(1/2*d*x + 1/2*c) - 1)^3) - (105*ta
n(1/2*d*x + 1/2*c)^6 + 735*tan(1/2*d*x + 1/2*c)^5 + 2030*tan(1/2*d*x + 1/2*c)^4 + 2030*tan(1/2*d*x + 1/2*c)^3
+ 1701*tan(1/2*d*x + 1/2*c)^2 + 707*tan(1/2*d*x + 1/2*c) + 116)/(a^2*(tan(1/2*d*x + 1/2*c) + 1)^7))/d